We are migrating the bug tracker to github Issues. This is now the preferred way to report NASM bugs.

Self-registration is disabled due to spam issue (mail gorcunov@gmail.com or hpa@zytor.com to create an account)

Bug 3392953 - -f bin map file doesn't cause a warning on trying to write to a nonexistent directory
Summary: -f bin map file doesn't cause a warning on trying to write to a nonexistent d...
Status: CLOSED FIXED
Alias: None
Product: NASM
Classification: Unclassified
Component: Assembler (show other bugs)
Version: 3.00.xx
Hardware: All All
: Medium minor
Assignee: nobody
URL:
Depends on:
Blocks:
 
Reported: 2025-09-05 14:15 PDT by E. C. Masloch
Modified: 2025-09-19 14:35 PDT (History)
5 users (show)

Obtained from: Built from git using configure
Generated by: Human
Bug category: Incorrect listing or map file output, Unexpected or confusing behavior
Observed for: Valid test code
Regression: No
Regression since:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description E. C. Masloch 2025-09-05 14:15:08 PDT
The documented output choices of stderr, stdout, and an explicit file all work. What doesn't work is when the file is specified with a directory that doesn't exist. I expected a warning or an error message but NASM appears to remain silent.

test$ cat test.asm

[map brief _MAP]

        section FOO
        times 16 nop
        section BAR
test$ nasm -v
NASM version 2.16.02rc2 compiled on Oct 12 2023
test$ nasm test.asm -D_MAP=stderr

- NASM Map file ---------------------------------------------------------------

Source file:  test.asm
Output file:  test

-- Program origin -------------------------------------------------------------

00000000

-- Sections (summary) ---------------------------------------------------------

Vstart            Start             Stop              Length    Class     Name
               0                 0                 0  00000000  progbits  .text
               0                 0                10  00000010  progbits  FOO
              10                10                10  00000000  progbits  BAR

test$ nasm test.asm -D_MAP=stdout

- NASM Map file ---------------------------------------------------------------

Source file:  test.asm
Output file:  test

-- Program origin -------------------------------------------------------------

00000000

-- Sections (summary) ---------------------------------------------------------

Vstart            Start             Stop              Length    Class     Name
               0                 0                 0  00000000  progbits  .text
               0                 0                10  00000010  progbits  FOO
              10                10                10  00000000  progbits  BAR

test$ nasm test.asm -D_MAP=test.lst
test$ rm test.lst
test$ nasm test.asm -D_MAP=quux/test.lst
test$ ls
test  test.asm
test$ ~/proj/nasmtest/patch/nasm -v
NASM version 2.17rc0 compiled on Sep  3 2025
test$ ~/proj/nasmtest/patch/nasm test.asm -D_MAP=stderr

- NASM Map file ---------------------------------------------------------------

Source file:  test.asm
Output file:  test

-- Program origin -------------------------------------------------------------

00000000

-- Sections (summary) ---------------------------------------------------------

Vstart            Start             Stop              Length    Class     Name
               0                 0                 0  00000000  progbits  .text
               0                 0                10  00000010  progbits  FOO
              10                10                10  00000000  progbits  BAR

test$ ~/proj/nasmtest/patch/nasm test.asm -D_MAP=stdout

- NASM Map file ---------------------------------------------------------------

Source file:  test.asm
Output file:  test

-- Program origin -------------------------------------------------------------

00000000

-- Sections (summary) ---------------------------------------------------------

Vstart            Start             Stop              Length    Class     Name
               0                 0                 0  00000000  progbits  .text
               0                 0                10  00000010  progbits  FOO
              10                10                10  00000000  progbits  BAR

test$ ~/proj/nasmtest/patch/nasm test.asm -D_MAP=test.lst
test$ rm test.lst
test$ ~/proj/nasmtest/patch/nasm test.asm -D_MAP=quux/test.lst
test$ ls
test  test.asm
test$
Comment 1 H. Peter Anvin 2025-09-19 14:28:56 PDT
This warning (which I guess never appeared?) has now been promoted to a warning, which is what it should have been all along.
Comment 2 H. Peter Anvin 2025-09-19 14:29:13 PDT
Promoted to an *error*.

This will be in 3.00rc10.
Comment 3 E. C. Masloch 2025-09-19 14:35:00 PDT
Yes, the warning wasn't shown ever in my tests. Thanks, it works as expected now.